package com.powerband.apiheartrate.base

import android.bluetooth.BluetoothDevice
interface FBKRepository {
    /**
     * 扫描设备
     * @param timeOut 超时时间 默认5秒
     */
    fun startScan(timeOut: Long? = 5000)

    /**
     * 停止扫描
     */
    fun stopScan()

    /**
     * 连接蓝牙设备
     * @param bluetoothDevice 原生蓝牙对象
     */
    fun connectBluetooth(bluetoothDevice: BluetoothDevice?, retryTime: Int? = 0)

    /**
     * 通过蓝牙地址连接
     * @param macAddress 蓝牙地址 xx:xx:xx:xx:xx:xx
     */
    fun connectBluetooth(macAddress: String?, retryTime: Int? = 0)

    /**
     * 断开连接
     */
    fun disconnectBle()

    /**
     * 注册蓝牙广播监听
     * STATE_CHANGED
       ACL_CONNECTED
       ACL_DISCONNECTED
     */
    fun registerBleListenerReceiver()

    /**
     * 注销广播监听
     */
    fun unregisterBleListenerReceiver()

    /**
     * 读特征值
     * @param status 是否开启监听
     * @param type FBKArmBandCmd.HeartRate/FBKArmBandCmd.Notify
     * HeartRate为心率、Notify为主服务回调,
     */
    fun toggleNotifyWith(status: Boolean, type: FBKArmBandCmd = FBKArmBandCmd.HeartRate)

    /**
     * 读取设备电量
     */
    fun readDeviceBatteryPower()

    /**
     * 读取设备固件版本
     */
    fun readFirmwareVersion()

    /**
     * 读取硬件版本
     */
    fun readHardwareVersion()

    /**
     * 读取软件版本
     */
    fun readSoftwareVersion()

    /**
     * 读取系统ID
     */
    fun readSystemId()

    /**
     * 读取Model
     */
    fun readModelString()

    /**
     * 读取厂商名称
     */
    fun readManufacturerName()

    /**
     * 读取设备序列号
     */
    fun getDeviceSerial()

    /**
     * 获取实时步频
     */
    fun getDeviceStepFrequency()

    /**
     * 获取实时血氧
     */
    fun getRealTimeOxygen()

    /**
     * 同步设备时间
     */
    fun syncTime()

    /**
     * 设置心跳阈值
     */
    fun setDeviceThreshold(min:Int, max: Int)

    /**
     * 查询充电状态
     */
    fun queryBatteryStatus()
    /**
     * OTA
     * @param file ota bin 文件路径
     */
    fun startOTA(file: ByteArray?)

    fun getSummaryHeartRate(startDateStamp: Long, endDateStamp: Long)
    fun getSummarySteps(startDateStamp: Long, endDateStamp: Long)
    fun getSummaryBloodOxygen(startDateStamp: Long, endDateStamp: Long)
    fun getSummaryPressureIndex(startDateStamp: Long, endDateStamp: Long)
    fun getSummaryCalorie(startDateStamp: Long, endDateStamp: Long)
    fun getSummarySleep(startDateStamp: Long, endDateStamp: Long)
    fun getExerciseData(startDateStamp: Long, endDateStamp: Long)
    fun getMotionData(pageSize: Int, sportMode:Boolean)

    /**
     * 查询设备模式
     */
    fun queryDeviceMode()
    fun switchDevieMode(mode: FBKDeviceMode)

    fun updateSeq(sportMode:Boolean)

    fun requestCurrentTime()

    fun keepSportAlive()
    fun qureySportModeDetail()
    fun resetFactory()
    fun setDoNotDisturbTime(enable: Boolean, startHour: Int = 0, startMin: Int = 0, endHour: Int = 0, endMin: Int = 0)

    fun forseSleepOut()

    fun lightSwitch(on: Boolean)
}